#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int INF = 0x3f3f3f3f;
int a[N];
bool Att[N];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    if(a[n] <= 2){
        int c1 = 0, c2 = 0;
        for(int i = 1; i <= n; i++){
            if(a[i] == 1) c1++;
            else c2++;
        }
        cout << (c2 >= c1 ? c2 : n - c2);
    }else if(n <= 1e4 + 4){
        int ans = 0;
        for(int i = 1; i <= n; i++){
            for(int j = i - 1; j >= 1; j--){
                if(a[i] > a[j] && !Att[i]){
                    a[j] = INF;
                    Att[i] = 1;
                    ++ans;
                }
            }
        }
        cout << n - ans;
    }
    return 0;
}
